package com.dk.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class RedisConfig {
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    //定时    每隔1分钟执行一次
    @Scheduled(cron = "0 */1 * * * ?")
    public void test02() {
        System.out.println(new Date());
        stringRedisTemplate.delete("SUM");
    }

}
